﻿using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Data;
using System.Data.Common;
using System.Text;

namespace SweetSQL.Data
{
    internal interface IConnectionProvider : IDisposable
    {
        int CommandTimeout
        {
            get;
        }

        IDbConnection Connection
        {
            get;
        }

        void Connect();

        void BeginTransaction();

        void Commit();

        void Rollback();

        IDbCommand CreateCommand(string sql);

        IDataParameter CreateParameter(string name, Type type, int index);

        object ConvertToClr(Type type, object value);

        object ConvertToDatabase(Type type, object value);
    }
}
